#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int testVillageEffect(struct gameState *state) {
	int handCnt, actionCount;
	//put village in hand and something else after it (so it can shift in to verify smithy left)
	state->hand[0][1] = village;
	state->hand[0][2] = smithy;
	handCnt = state->handCount[0];
	actionCount = state->numActions;
	//play village
	cardEffect(village, 0, 0, 0, state, 1, 0);
	//check that village is no longer in that position
	assert(village != state->hand[0][1]);
	printf("\tCard was discarded");
	//handCount should be the same as before (spent village, plus the drawCard)
	assert(state->handCount[0] == handCnt);
	printf(", hand has correct number of cards");
	//actionCount should be 2 greater than before
	assert(state->numActions = actionCount + 2);
	printf(", action count was adjusted correctly\n");
	return 0;
}

int main() {
    
    int seed = 1000;
    int numPlayer = 3;
    
	struct gameState G;
	struct gameState *state = &G;
	int k[10] = {council_room, smithy, steward, remodel, village, minion, mine, cutpurse, 
		   sea_hag, tribute};

	initializeGame(numPlayer, k, seed, &G);
	printf("Testing villageEffect():\n");
	testVillageEffect(state);
	
	printf("   villageEffect() Passed all tests!\n");
	

    return 0;
}

